package org.dong.base.thread;


import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class ThreadDemo1 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Thread t1 = new ThreadA();
        t1.start();
        System.out.println("start后线程1的状态："+t1.getState());
        Thread t2 = new Thread(new ThreadB());
        t2.start();

        t1.join();

        FutureTask<String> futureTask = new FutureTask<>(new ThreadC());
        Thread t3 = new Thread(futureTask);
        t3.start();
        System.out.println("t3 的执行结果为："+futureTask.get());

        System.out.println("this is main thread");
    }
}
